<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>会员业务类型</title>
<script type="text/javascript" src="../boot.js"></script>
<script>
var tbgrid;

function parsePage(){

tbgrid = $('#tbList').datagrid({
			data:{"total":3,"rows":[{'id':'1','col1':'平台代发','col2':0,'col3':'不限制'},{'id':'2','col1':'线上小额批发','col2':800,'col3':'不限制'},{'id':'3','col1':'线上大额批发','col2':900,'col3':'不限制'}]},
			singleSelect:true,
		    columns:[[
					{
					title:'分销业务类型',
					field:'col1',
					width:120,
					sortable:true
				  },
					{
					title:'金额最低限制(元)',
					field:'col2',
					width:100
					},{
					title:'收货地址',
					field:'col3',
					width:100
					},{
					title:'操作',
					field:'opt',
					width:100,
					formatter:function(value,rec,index){
						var str='<a href="javascript:;" class="jsEdit">编辑</a>';
						return str;
					}
					}
		]],
		toolbar:[{}],
		onLoadSuccess:function(){
			$('.jsEdit').click(function(){
				edit();
				return false;
			});
			
			$('.jsDel').click(function(){
				var _idx=$('.jsDel').index(this);
				var id=tbgrid.datagrid('getRows')[_idx].id;
				del(id);
				return false;
			});
			
		}

	});

}


function edit(){
	ygDialog({
		title:'编辑分销业务类型',
		href:'member-biztype-edit.html',
		width:600,
		height:250,
		buttons:[{
			text:'确认',
			handler:function(dialog){
				save(dialog);
			}
		},{
			text:'取消',
			handler:function(dialog){
				dialog.close();
			}
		}]

	});
}

function save(dialog){
	var myform=$('#myForm');
	myform.form({
		url:'form3_proc.php',
		onSubmit:function(){
			return $(this).form('validate');
		},
		success:function(data){
			showSuc('操作成功！');
			dialog.close();
		}
	});
	myform.submit();
}
</script>
</head>

<body class="easyui-layout">

<div  data-options="region:'center',border:false">
    <table id="tbList">
    </table>
</div>
</body>
</html>
